package com.prs.crm.vo.project;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;

public class TaskVo implements java.io.Serializable{
	
	private static final long serialVersionUID = 1L;

	private Integer id;
	
	private String name;
	
	private String executor;
	
	private Integer percent;
	
	private Collection<TaskVo> childs;
	
	private String startTime;
	
	private String endTime;
	
	private Boolean overTime;
	
	public TaskVo()
	{
		this.overTime = false;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setExecutor(String executor) {
		this.executor = executor;
	}

	public String getExecutor() {
		return executor;
	}

	public void setPercent(Integer percent) {
		this.percent = percent;
	}

	public Integer getPercent() {
		return percent;
	}

	public void setChilds(Collection<TaskVo> childs) {
		this.childs = childs;
	}

	public Collection<TaskVo> getChilds() {
		return childs;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}
	public void setStartTime(Date time)
	{
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(time);
		this.startTime = (calendar.get(Calendar.MONTH)+1)+"/"+calendar.get(Calendar.DATE)+"/"+calendar.get(Calendar.YEAR);
	}

	public String getStartTime() {
		return startTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	public void setEndTime(Date time)
	{
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(time);
		this.endTime = (calendar.get(Calendar.MONTH)+1)+"/"+calendar.get(Calendar.DATE)+"/"+calendar.get(Calendar.YEAR);
	}

	public String getEndTime() {
		return endTime;
	}
	
	
	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public void addChild(TaskVo child)
	{
		if (childs==null)
			childs = new ArrayList<TaskVo>();
		childs.add(child);
	}

	public void setOverTime(boolean overTime) {
		this.overTime = overTime;
	}

	public boolean isOverTime() {
		return overTime;
	}



}
